---OOSE SoSe 2011 Aufgabe 3
--@author Oleg Mayevskiy <mayevskiy.oleg@googlemail.com> (233197)

require('classes')
require('Player')

Role{"ComputerPlayer", nil, Player,
game = Game}

function ComputerPlayer:read()
	local turns = self.game:getPossibleTurns()

	--init random function
	--look at: http://lua-users.org/wiki/MathLibraryTutorial ! :-\
	math.randomseed(os.time())
	for i=1,3 do
		math.random()
	end

	--random position in turns table
	local rnd = math.random(1, #turns)
	--return random value at random position of turn table
	return turns[rnd]
end
